{{#
var dTT = {
	widthFn: function(v) {
		if(typeof v.width == 'number') {
			v.width = v.width + 'px'
		};
		if(v.width) {
			return 'width:' + v.width + ';';
		} else {
			return ''
		}
	},
	width2Fn: function(v) {
		if(typeof v.width == 'number') {
			v.width = v.width + 'px'
		};
		if(v.width && (v.width + '').indexOf('%') == -1) {
			return 'min-width:' + v.width + ';';
		} else {
			return ''
		}
	},
	heightFn: function(v) {
		if(v.height) {
			return 'max-height:' + v.height + ';';
		} else {
			return ''
		}
	},
	alignFn: function(v) {
		if(v.align) {
			return 'text-align:' + v.align + ';';
		} else {
			return ''
		}
	},
	styleFn: function(v) {
		if(v.style) {
			return v.style;
		} else {
			return ''
		}
	},
	classFn: function(v) {
		var val = '';
		if(v.fixed == 'left') {
			val = ' fixed-left'
		} else if(v.fixed == 'right') {
			val = ' fixed-right'
		}
		return val;
	},
	titleFn: function(v) {
		var val = '';
		if(v.title) {
			val = v.title
		} else {
			if(v.type == 'checkbox') {
				if(v.checked) {
					val = '<input class="cb-all" type="checkbox" checked/>'
				} else {
					val = '<input class="cb-all" type="checkbox"/>'
				}
			}
		}
		return val;
	},
	contentFn: function(t, b, i) {
		var k = t.field,
			val = '';
		if(k) {
			if(typeof k === 'string') {
				val = b['' + k]
			} else {
				try {
					val = k(b)
				} catch(err) {
					console.error(JSON.stringify(t) + '<<<===中===>>>' + k + '===>>>错误')
				}
			}
		} else if(t.type == 'checkbox') {
			if(b.checked) {
				if(b.disabled) {
					val = '<input class="cb-item-disabled" type="checkbox" checked disabled value="' + i + '"/>'
				} else {
					val = '<input class="cb-item" type="checkbox" checked value="' + i + '"/>'
				}
			} else {
				if(b.disabled) {
					val = '<input type="checkbox" class="cb-item-disabled" disabled value="' + i + '" />'
				} else {
					val = '<input class="cb-item" type="checkbox" value="' + i + '"/>'
				}
			}
		} else if(t.type == 'numbers') {
			val = i + 1
		}
		return val;
	}
};
}}

<div class="m-table" style="{{dTT.heightFn(d)}}">
	<table style="{{dTT.widthFn(d)}}">
		<tbody>
			<tr class="{{d.height?'fixed-top ':''}}thead">
				{{# $.each(d.cols,function(_i,v){ }}<td class="{{dTT.classFn(v)}}" style="{{dTT.widthFn(v)}}{{dTT.alignFn(v)}}{{dTT.styleFn(v)}}">
					<div style="{{dTT.width2Fn(v)}}">{{dTT.titleFn(v)}}</div>
				</td>{{# }) }}
			</tr>
			{{# $.each(d.data,function(i,b){ }}<tr class="tbody" item-index="{{i}}">
				{{# $.each(d.cols,function(_i,t){ }}<td class="{{dTT.classFn(t)}}" style="{{dTT.alignFn(t)}}{{dTT.styleFn(t)}}">{{dTT.contentFn(t,b,i)}}</td>{{# }) }}
			</tr>{{# }) }}
			{{# if(d.data.length==0){ }}<tr>
				<td class="textC" colspan="{{d.cols.length}}">暂无数据</td>
			</tr>{{# } }}
			{{# if(d.total){ }}<tr class="{{d.height?'fixed-bottom ':''}}tfoot">
				{{# $.each(d.cols,function(i,v){ }}<td class="{{dTT.classFn(v)}}" style="{{dTT.alignFn(v)}}{{dTT.styleFn(v)}}">{{d.total[i]}}</td>{{# }) }}
			</tr>{{# } }}
		</tbody>
	</table>
</div>